From: Cosimo Cecchi Date: Thu, 11 Oct 2018 02:08:38 +0000 (-0700) Subject: calendar: do not call destroy() recursively X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2~1^2~50 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5fb8d4f730;p=gnome-shell.git calendar: do not call destroy() recursively We have a callback that will call close() when the notification is destroyed, and a callback that will call destroy() on the notification when the message is closed. Currently, if the notification is destroyed we'll execute our callback that will call again destroy() on the notification. That's bad practice in general, and it also has the side effect of resetting the destroy reason. This commit avoids re-destroying the notification by dropping the notification reference on destroy. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/258 --- diff --git a/js/ui/calendar.js b/js/ui/calendar.js index 241a91db4..432986391 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -773,9 +773,11 @@ var NotificationMessage = new Lang.Class({ this.connect('close', () => { this._closed = true; - this.notification.destroy(MessageTray.NotificationDestroyedReason.DISMISSED); + if (this.notification) + this.notification.destroy(MessageTray.NotificationDestroyedReason.DISMISSED); }); this._destroyId = notification.connect('destroy', () => { + this.notification = null; if (!this._closed) this.close(); });